﻿using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using StackExchange.Profiling;

namespace ED.MiniProfiler
{
    public static class MiniProfilerExtensions
    {
        public static IServiceCollection AddCustomMiniProfiler(this IServiceCollection services)
        {
            services.AddMiniProfiler(options => {
                options.RouteBasePath = "/profiler";
                // 设定弹出窗口的位置是左下角
                options.PopupRenderPosition = RenderPosition.BottomLeft;
                // 设定在弹出的明细窗口里会显式Time With Children这列
                options.PopupShowTimeWithChildren = true;
                options.IgnorePath("/File/");
            });
            return services;
        }
    }
}